# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PipelineJob do
  @moduledoc """
  An instance of a machine learning PipelineJob.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Pipeline creation time.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - The display name of the Pipeline. The name can be up to 128 characters long and can consist of any UTF-8 characters.
  *   `encryptionSpec` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1EncryptionSpec.t`, *default:* `nil`) - Customer-managed encryption key spec for a pipelineJob. If set, this PipelineJob and all of its sub-resources will be secured by this key.
  *   `endTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Pipeline end time.
  *   `error` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleRpcStatus.t`, *default:* `nil`) - Output only. The error that occurred during pipeline execution. Only populated when the pipeline's state is FAILED or CANCELLED.
  *   `jobDetail` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PipelineJobDetail.t`, *default:* `nil`) - Output only. The details of pipeline run. Not available in the list view.
  *   `labels` (*type:* `map()`, *default:* `nil`) - The labels with user-defined metadata to organize PipelineJob. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels. Note there is some reserved label key for Vertex AI Pipelines. - `vertex-ai-pipelines-run-billing-id`, user set value will get overrided.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name of the PipelineJob.
  *   `network` (*type:* `String.t`, *default:* `nil`) - The full name of the Compute Engine [network](/compute/docs/networks-and-firewalls#networks) to which the Pipeline Job's workload should be peered. For example, `projects/12345/global/networks/myVPC`. [Format](/compute/docs/reference/rest/v1/networks/insert) is of the form `projects/{project}/global/networks/{network}`. Where {project} is a project number, as in `12345`, and {network} is a network name. Private services access must already be configured for the network. Pipeline job will apply the network configuration to the Google Cloud resources being launched, if applied, such as Vertex AI Training or Dataflow job. If left unspecified, the workload is not peered with any network.
  *   `pipelineSpec` (*type:* `map()`, *default:* `nil`) - The spec of the pipeline.
  *   `preflightValidations` (*type:* `boolean()`, *default:* `nil`) - Optional. Whether to do component level validations before job creation.
  *   `reservedIpRanges` (*type:* `list(String.t)`, *default:* `nil`) - A list of names for the reserved ip ranges under the VPC network that can be used for this Pipeline Job's workload. If set, we will deploy the Pipeline Job's workload within the provided ip ranges. Otherwise, the job will be deployed to any ip ranges under the provided VPC network. Example: ['vertex-ai-ip-range'].
  *   `runtimeConfig` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PipelineJobRuntimeConfig.t`, *default:* `nil`) - Runtime config of the pipeline.
  *   `scheduleName` (*type:* `String.t`, *default:* `nil`) - Output only. The schedule resource name. Only returned if the Pipeline is created by Schedule API.
  *   `serviceAccount` (*type:* `String.t`, *default:* `nil`) - The service account that the pipeline workload runs as. If not specified, the Compute Engine default service account in the project will be used. See https://cloud.google.com/compute/docs/access/service-accounts#default_service_account Users starting the pipeline must have the `iam.serviceAccounts.actAs` permission on this service account.
  *   `startTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Pipeline start time.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The detailed state of the job.
  *   `templateMetadata` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PipelineTemplateMetadata.t`, *default:* `nil`) - Output only. Pipeline template metadata. Will fill up fields if PipelineJob.template_uri is from supported template registry.
  *   `templateUri` (*type:* `String.t`, *default:* `nil`) - A template uri from where the PipelineJob.pipeline_spec, if empty, will be downloaded. Currently, only uri from Vertex Template Registry & Gallery is supported. Reference to https://cloud.google.com/vertex-ai/docs/pipelines/create-pipeline-template.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when this PipelineJob was most recently updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :displayName => String.t() | nil,
          :encryptionSpec =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1EncryptionSpec.t() | nil,
          :endTime => DateTime.t() | nil,
          :error => GoogleApi.AIPlatform.V1.Model.GoogleRpcStatus.t() | nil,
          :jobDetail =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PipelineJobDetail.t() | nil,
          :labels => map() | nil,
          :name => String.t() | nil,
          :network => String.t() | nil,
          :pipelineSpec => map() | nil,
          :preflightValidations => boolean() | nil,
          :reservedIpRanges => list(String.t()) | nil,
          :runtimeConfig =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PipelineJobRuntimeConfig.t()
            | nil,
          :scheduleName => String.t() | nil,
          :serviceAccount => String.t() | nil,
          :startTime => DateTime.t() | nil,
          :state => String.t() | nil,
          :templateMetadata =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PipelineTemplateMetadata.t()
            | nil,
          :templateUri => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:displayName)
  field(:encryptionSpec, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1EncryptionSpec)
  field(:endTime, as: DateTime)
  field(:error, as: GoogleApi.AIPlatform.V1.Model.GoogleRpcStatus)
  field(:jobDetail, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PipelineJobDetail)
  field(:labels, type: :map)
  field(:name)
  field(:network)
  field(:pipelineSpec, type: :map)
  field(:preflightValidations)
  field(:reservedIpRanges, type: :list)

  field(:runtimeConfig,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PipelineJobRuntimeConfig
  )

  field(:scheduleName)
  field(:serviceAccount)
  field(:startTime, as: DateTime)
  field(:state)

  field(:templateMetadata,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PipelineTemplateMetadata
  )

  field(:templateUri)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PipelineJob do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PipelineJob.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PipelineJob do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
